#!/bin/sh
if [ -z $1 ];then
        echo ""
        echo -n "Input version:"
  read version
else
  version=$1
fi

/etc/init.d/tomcat.sh stop
wget --http-user=deployment --http-password='lll123!@#' http://172.16.10.99:8081/nexus/content/repositories/snapshots/com/nineteenlou/war-center/${version}/war-center-${version}.war
rm -rf /usr/local/app/apache-tomcat-6.0.32/webapps/war-center.war
rm -rf /usr/local/app/apache-tomcat-6.0.32/webapps/war-center

mv war-center-${version}.war /usr/local/app/apache-tomcat-6.0.32/webapps/war-center.war

/etc/init.d/tomcat.sh start
tail -f /usr/local/app/apache-tomcat-6.0.32/logs/catalina.out
